UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+Lq+7qdsKc9GKhy5NGNmH7+C4NBZ8QBmz7m6ZMoQBQU=' 
WHERE 
  key_id = '89491ac77df453af129bb42c474aea16a23f89fb52b5787ef9b11175f0d191de' 
  AND (
    token = '+Lq+7qdsKc9GKhy5NGNmH7+C4NBZ8QBmz7m6ZMoQBQU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038