UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RJc6zB1cCjXQi+0dmHKXUKBvANI0xx5lYpiVlibzipo='
WHERE
key_id = 'fe1b515eff9236d96cefbfec961690adcad5231c53345c409bb034acd20f6d53'
AND (
token = 'RJc6zB1cCjXQi+0dmHKXUKBvANI0xx5lYpiVlibzipo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)