UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l7Q+Vl0+hZxq6AFfoUWkiyI+AO0+pLNGp/vnMQwuOYw='
WHERE
key_id = '475af72be86b1eaebbf5a25c5c5beef0ebf3b45ef7832e149163530c7cca0451'
AND (
token = 'l7Q+Vl0+hZxq6AFfoUWkiyI+AO0+pLNGp/vnMQwuOYw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)