UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NTfi5OOmRuHpxuyoLtXBmP8hSBgucXYhROneaUSbTp0='
WHERE
key_id = 'ef95f9f796e4a20d9a4717e60fabe9bfd3aad0607cbb7d83238fa1b46f222bc4'
AND (
token = 'NTfi5OOmRuHpxuyoLtXBmP8hSBgucXYhROneaUSbTp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)