UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QYw/gYLIi3Kg6kwHB/hmMyTejNZoh9Ky0LP6onI0PcQ=' 
WHERE 
  key_id = '9924e5bb71760e5d2ba927b041fd1bfe5748a955f2319a11c5ad798c905f677b' 
  AND (
    token = 'QYw/gYLIi3Kg6kwHB/hmMyTejNZoh9Ky0LP6onI0PcQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019