UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's7+sLSIrH23v2GeOriZyVgl7AJxY9DGZf9Y7Fv9V2Hw='
WHERE
key_id = '498a92d8a3b571d169b2959d8e68cb7ea39ee2e32caa72bf9b925ff0e09cf238'
AND (
token = 's7+sLSIrH23v2GeOriZyVgl7AJxY9DGZf9Y7Fv9V2Hw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)