UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AbTWMudnRBStH52M8oCjxQfKp3ihnMFEnvsQNmmo+7U=' 
WHERE 
  key_id = '79280c8c51eee0ba2a9c484fc2d8642ba98e2c83ec843f180938f3e1e281f2cc' 
  AND (
    token = 'AbTWMudnRBStH52M8oCjxQfKp3ihnMFEnvsQNmmo+7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00087