UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LfQk0f81iB5rYUoQd4Uz9xDNsEXnDoQn6tEfh7512JU='
WHERE
key_id = '865f0b7a4af09faaf25fbd50bb0f66f66df81ac9854387c4a5a6a381fdeaa6c5'
AND (
token = 'LfQk0f81iB5rYUoQd4Uz9xDNsEXnDoQn6tEfh7512JU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)