UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fvMqprQ3M51RprVr0IVJJNvWmtObSoZQ5eCWJb8nnyI='
WHERE
key_id = '439bac9a217d813f3aaf725963ae6bccad79bce6e5820db6f3e92ffc5308256e'
AND (
token = 'fvMqprQ3M51RprVr0IVJJNvWmtObSoZQ5eCWJb8nnyI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)