UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5ADo3+ZiKWs5P59A55ddFsz1Fs3aBubpfju+xXcXX5w=' 
WHERE 
  key_id = '2e3e74adf950fb530a1bb40ee0a26098efa7df0218dc5ba8276ebf4ad18c86b7' 
  AND (
    token = '5ADo3+ZiKWs5P59A55ddFsz1Fs3aBubpfju+xXcXX5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042