UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TBbcR017J7J4QaUmfQd5MPzD/kUoXJUrlWX7jUpZFPs='
WHERE
key_id = '5d129be7a6f3b4fa19a3ff24f00396d161e8d0f67109a1926f05292a9a3678b3'
AND (
token = 'TBbcR017J7J4QaUmfQd5MPzD/kUoXJUrlWX7jUpZFPs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)