UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ajHWsw0XH/ZC1KjQ2REArqV+TT4bGJ8NEz8/z2qLo5c='
WHERE
key_id = '7c7ef147d9ded26588051e888b642887f32bac43a07c69d5b8bc76efb029a0c7'
AND (
token = 'ajHWsw0XH/ZC1KjQ2REArqV+TT4bGJ8NEz8/z2qLo5c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)