UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7dAYScNegi+mq7LQlJmeDHOz7QEo2LLWbYedbJcCn6M='
WHERE
key_id = '3914c71ab6915a606fdf2893189221749fe57f86420073cb3525703ab2628453'
AND (
token = '7dAYScNegi+mq7LQlJmeDHOz7QEo2LLWbYedbJcCn6M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)