UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LXe9qs7lG++mZPP0RyCyJ/6Wyo6E1aQTJQNuDHmhLkQ='
WHERE
key_id = '4de323feade83af3a9b5e2a4cc9b3709f04b5be81e1b76980812932f36275c0f'
AND (
token = 'LXe9qs7lG++mZPP0RyCyJ/6Wyo6E1aQTJQNuDHmhLkQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)