UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UsoqwseVIrwHyd4s32FuPwMlgwYhHKMCc6dDnNEjUQc='
WHERE
key_id = '6ca16e928525e6d897ed724de9499a52e02403b8e092637010abc5700fe6dfa7'
AND (
token = 'UsoqwseVIrwHyd4s32FuPwMlgwYhHKMCc6dDnNEjUQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)