UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EUB0xArOhbeuMCehReejKCsB6RFGJhNPGhTHvLki3T4='
WHERE
key_id = '22ef0cd08415907b6a6c9c59e4115b8c565248358435c37f10e584b7b1c58e24'
AND (
token = 'EUB0xArOhbeuMCehReejKCsB6RFGJhNPGhTHvLki3T4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)