UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0WsxyFFwjAj8uGzN73VNWIbBZSRuJm+njqVhXIUTwzU='
WHERE
key_id = '00ae50712f93e2596409ea87f82f6b5ae5b007d76c64c4bd5a4cd880830b6c17'
AND (
token = '0WsxyFFwjAj8uGzN73VNWIbBZSRuJm+njqVhXIUTwzU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)