UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JkgoEIG3w72v4MjC9T6dAptGa60lNA8ojcJaR/SZwEA='
WHERE
key_id = 'de9b63eaf3d09e48d25b9a77d5fee3f71ebfc1cc7812e5043452ee33aee4abd4'
AND (
token = 'JkgoEIG3w72v4MjC9T6dAptGa60lNA8ojcJaR/SZwEA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)