UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q2d7rjFK9UG1wy04LkKDWf1iNFbWHTHE8wX30zN7UuE=' 
WHERE 
  key_id = 'f71cef943cc7a89b53af9cf246ae0edd265ea003778b0adf82189ce2849d127c' 
  AND (
    token = 'Q2d7rjFK9UG1wy04LkKDWf1iNFbWHTHE8wX30zN7UuE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025