UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zPFnkVtuEPwW2B2u1WjXbceQUzlh1mUTW9ywIZUt3tU='
WHERE
key_id = '08fa720acdb258ce35582c143e37e696588e67eb2a10bd975571f4e61a7ff4c2'
AND (
token = 'zPFnkVtuEPwW2B2u1WjXbceQUzlh1mUTW9ywIZUt3tU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)