UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/NHxVl9PUDzdCcK6wampWT7X/kF92UID4V3U1uqLBgE='
WHERE
key_id = 'a40b05a6fd91980baa4a2097b56c730bc9d2bc728fab7946b45ce99cb59d96b3'
AND (
token = '/NHxVl9PUDzdCcK6wampWT7X/kF92UID4V3U1uqLBgE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)