UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GypVJmqrCvKnUOQ6z+GLFMAYqNJgLdN1Vrzu28aHNak=' 
WHERE 
  key_id = 'b73f6767dbe345965093023261393cb22410423c0945b4f7ca0c5bcc93b931fe' 
  AND (
    token = 'GypVJmqrCvKnUOQ6z+GLFMAYqNJgLdN1Vrzu28aHNak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00140