UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YJqGx6yepVZF+8EXJdniy2dQvsRhzQqTKquuL1CM4Y0='
WHERE
key_id = '5f61f8fbc6adadb70ea4b844f546ca87eabeb4a99cf9b2a8a429267c625daf53'
AND (
token = 'YJqGx6yepVZF+8EXJdniy2dQvsRhzQqTKquuL1CM4Y0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)