UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1FD7HNsCBcK+ISDNJgf0wN5eYnX9NRx49HyX6pZI2X0='
WHERE
key_id = '1714bb18abe3ce97632352ea53eed1b2c021bdacc60d0cfb259ec9e8d689818d'
AND (
token = '1FD7HNsCBcK+ISDNJgf0wN5eYnX9NRx49HyX6pZI2X0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)