UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Yx4uqHx9WattIBrZY/YOG1qfJAtP1YzAVQrja/BVCrA=' 
WHERE 
  key_id = 'd432e110420f69b1244d06ff124ed889c048e00762b5e81063b735070298321f' 
  AND (
    token = 'Yx4uqHx9WattIBrZY/YOG1qfJAtP1YzAVQrja/BVCrA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021