UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CawL3NNWlJ3/Ftzmihxq9zAIy0WqBSV3cOKadXnuF64=' 
WHERE 
  key_id = '0776707a7de87741bf4a6505d2e054b91e4d2671aaec869c324b9c16807d53c6' 
  AND (
    token = 'CawL3NNWlJ3/Ftzmihxq9zAIy0WqBSV3cOKadXnuF64=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028