UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/xvF0PCMiYd/LSOK82UnlxKi53WqIRr79PtqGaJxD/I=' 
WHERE 
  key_id = '21c2e9fee727c267b68631f622a6d1af01bc2c9a8143b789f8048592b46c7780' 
  AND (
    token = '/xvF0PCMiYd/LSOK82UnlxKi53WqIRr79PtqGaJxD/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016