UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CZOWb1NULOBXUG72g4gl1NnatuvSO4q2jkwVV/11R7o=' 
WHERE 
  key_id = '27752156ae42bdedfeea55f9708f76485e3f36cd3bea984309f8e15d43024357' 
  AND (
    token = 'CZOWb1NULOBXUG72g4gl1NnatuvSO4q2jkwVV/11R7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022