UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '96ee7jNIs2VJIyiqgSxgrbefV/SRcxMnvgZkUKH8p3s=' 
WHERE 
  key_id = '3188c696b0be3bde7521d74eaad7559ea97342db27ff3689339589c99dfa8559' 
  AND (
    token = '96ee7jNIs2VJIyiqgSxgrbefV/SRcxMnvgZkUKH8p3s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019