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