UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7V4GC/cfpm9sKJQGw3BzU/hCUMHhNDZrd9CDKOg3HpI='
WHERE
key_id = 'bc07088b6f4671fff848a89b62efd20aca054d02ae6752de0c82f1a6e2861215'
AND (
token = '7V4GC/cfpm9sKJQGw3BzU/hCUMHhNDZrd9CDKOg3HpI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)